package com.iot.gateway.tsl.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * 设备协议扩展实体（JSON 整存）
 */
@Data
@TableName(value = "tsl_device_spec", autoResultMap = true)
public class TslDeviceSpecEntity {

    @TableId
    private String deviceId;

    /**
     * 整个 specs 对象，MyBatis‑Plus 会自动将 Map ↔ JSON 转换
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> specs;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;
}
